package com.mycom.service.impl;

import com.mycom.dao.TeamSubmitWaitCertainDao;
import com.mycom.dao.TeamWaitCertainDao;
import com.mycom.pojo.TeamSubmitWaitCertain;
import com.mycom.pojo.TeamWaitCertain;
import com.mycom.service.TeamSubmitWaitCertainService;
import com.mycom.service.TeamWaitCertainService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TeamSubmitWaitCertainServiceImpl implements TeamSubmitWaitCertainService {
    @Autowired
    private TeamSubmitWaitCertainDao teamSubmitWaitCertainDao;

    @Override
    public boolean save(TeamSubmitWaitCertain teamSubmitWaitCertain) {
        return teamSubmitWaitCertainDao.save(teamSubmitWaitCertain) > 0 ? true : false;
    }

    public List<TeamSubmitWaitCertain> findByFormId(Integer formId){
        return teamSubmitWaitCertainDao.findByFormId(formId);
    }

    public boolean deleteByFormId(Integer formId){
        return teamSubmitWaitCertainDao.deleteByFormId(formId) >=0 ? true : false;
    }

    @Override
    public List<TeamSubmitWaitCertain> findByIdCardAndState(String idCardNumber, Integer state) {
        return teamSubmitWaitCertainDao.findByIdCardAndState(idCardNumber,state);
    }

    public boolean updateState(TeamSubmitWaitCertain member){
        return teamSubmitWaitCertainDao.updateState(member) > 0 ? true : false;
    }

    public TeamSubmitWaitCertain findById(Integer id){
        return teamSubmitWaitCertainDao.findById(id);
    }
}

